﻿using Infragistics.Controls.Charts;
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using VNet.VisiSuite.VisiAdmin.Models;

namespace VNet.VisiSuite.VisiAdmin.Controls
{
    public partial class HourlyProductionMeter : UserControl
    {
        public HourlyProductionMeter()
        {
            InitializeComponent();
        }

        //public BubbleDataSample ItemsSource
        //{
        //    get { return (BubbleDataSample)GetValue(ItemsSourceProperty); }
        //    set { SetValue(ItemsSourceProperty, value); }
        //}

        //public static readonly DependencyProperty ItemsSourceProperty =
        //    DependencyProperty.Register("ItemsSource", typeof(BubbleDataSample), typeof(HourlyProductionMeter), new PropertyMetadata(null, ItemsSouceCallback));

        private static void ItemsSouceCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var hpm = (HourlyProductionMeter)d;
            //hpm.ScatterLineSeries.ItemsSource = hpm.ItemsSource;


            //hpm.StackedBarSeries.ItemsSource = hpm.BarYAxis.ItemsSource = hpm.ItemsSource;

            //var listRollup = hpm.ItemsSource.Select(t => t.RollupDefinition).Distinct();
            //hpm.StackedBarSeries.Series.Clear();
            //foreach (var rollup in listRollup)
            //{
            //    var st = new StackedFragmentSeries();
            //    st.ValueMemberPath = "RollupDefinition.Value";//s.Items[" + rollup.RollupDefinitionId + "]";
            //    st.Title = rollup.Description;
            //    st.Brush = new SolidColorBrush(rollup.Color);
            //    hpm.StackedBarSeries.Series.Add(st);
            //}

        }
    }
}
